1500 |
How can I add a Zero-Lenght bar
with G2antt1 do begin BeginUpdate(); MarkSearchColumn := False; with Columns do begin Add('Tasks'); (IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1); (IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2); (IUnknown(Add('Duration')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(258); end; with Chart do begin FirstVisibleDate := '9/20/2010'; LevelCount := 2; PaneWidth[False] := 256; AllowLinkBars := False; end; with Items do begin AllowCellValueToItemBar := True; h1 := AddItem('M1'); AddBar(h1,'Milestone','9/29/2010','9/29/2010',Null,Null); ItemBar[h1,'',EXG2ANTTLib_TLB.exBarKeepWorkingCount] := OleVariant(True); end; EndUpdate(); end |
1499 |
Can I use bars like Milestone (Zero-Length bar) in SchedulePDM
// BarResizing event - Occurs when a bar is moving or resizing. procedure TForm1.G2antt1BarResizing(ASender: TObject; Item : HITEM;Key : OleVariant); begin with G2antt1 do begin OutputDebugString( Items.SchedulePDM(Item,OleVariant(Key)) ); end end; with G2antt1 do begin BeginUpdate(); MarkSearchColumn := False; with Columns do begin Add('Tasks'); (IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1); (IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(543); (IUnknown(Add('Duration')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(258); end; with ConditionalFormats.Add('%3',Null) do begin Bold := True; ApplyTo := EXG2ANTTLib_TLB.exFormatToItems; end; with ConditionalFormats.Add('%3 = 0',Null) do begin ForeColor := $c4c4c4; ApplyTo := EXG2ANTTLib_TLB.FormatApplyToEnum($3); end; with Chart do begin FirstVisibleDate := '9/20/2010'; LevelCount := 2; PaneWidth[False] := 256; Bars.Add('Task:Split').Shortcut := 'Task'; end; with Items do begin AllowCellValueToItemBar := True; h1 := AddItem('M1'); AddBar(h1,'Milestone','9/27/2010','9/27/2010',Null,Null); ItemBar[h1,'',EXG2ANTTLib_TLB.exBarKeepWorkingCount] := OleVariant(True); h2 := AddItem('T1'); AddBar(h2,'Task','9/27/2010','9/27/2010',Null,Null); ItemBar[h2,'',EXG2ANTTLib_TLB.exBarEndInclusive] := '9/27/2010'; ItemBar[h2,'',EXG2ANTTLib_TLB.exBarKeepWorkingCount] := OleVariant(True); AddLink('L1',h1,'',h2,''); h3 := AddItem('T2'); AddBar(h3,'Task','9/27/2010','9/27/2010',Null,Null); ItemBar[h3,'',EXG2ANTTLib_TLB.exBarEndInclusive] := '9/27/2010'; ItemBar[h3,'',EXG2ANTTLib_TLB.exBarKeepWorkingCount] := OleVariant(True); AddLink('L2',h1,'',h3,''); Link['L2',EXG2ANTTLib_TLB.exLinkPDMWorkingDelay] := OleVariant(5); h4 := AddItem('M3'); AddBar(h4,'Milestone','9/27/2010','9/27/2010',Null,Null); ItemBar[h4,'',EXG2ANTTLib_TLB.exBarKeepWorkingCount] := OleVariant(False); AddLink('L3',h1,'',h4,''); Link['L3',EXG2ANTTLib_TLB.exLinkPDMWorkingDelay] := OleVariant(5); SchedulePDM(0,''); end; EndUpdate(); end |
1498 |
How can I prevent vertical scrolling when user clicks the overview part of the control
// AddItem event - Occurs after a new Item has been inserted to Items collection. procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM); begin with G2antt1 do begin with Items do begin AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null); end; end end; with G2antt1 do begin BeginUpdate(); with Chart do begin FirstVisibleDate := '8/3/1994'; PaneWidth[False] := 256; LevelCount := 2; UnitScale := EXG2ANTTLib_TLB.exDay; FirstWeekDay := EXG2ANTTLib_TLB.exMonday; OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible; end; ColumnAutoResize := False; ContinueColumnScroll := False; rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset); with rs do begin Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null); end; DataSource := (IUnknown(rs) as ADODB_TLB.Recordset); Items.AllowCellValueToItemBar := True; Columns.Item[OleVariant(2)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1); Columns.Item[OleVariant(4)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2); EndUpdate(); end |
1497 |
I need to specify the start and end dates of the bar to be the same, but no bars are shown. (recommended for bars with exBarKeepWorkingCount ) What I can do
with G2antt1 do begin BeginUpdate(); MarkSearchColumn := False; with Columns do begin Add('Tasks'); (IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1); (IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(543); end; with Chart do begin FirstVisibleDate := '9/20/2006'; LevelCount := 2; PaneWidth[False] := 256; ShowEmptyBars := 0; end; with Items do begin AllowCellValueToItemBar := True; h := AddItem('Task 1'); AddBar(h,'Task','9/21/2006','9/21/2006',Null,Null); ItemBar[h,'',EXG2ANTTLib_TLB.exBarEndInclusive] := ItemBar[h,'',EXG2ANTTLib_TLB.exBarStart]; ItemBar[h,'',EXG2ANTTLib_TLB.exBarKeepWorkingCount] := OleVariant(True); h := AddItem('Task 2'); AddBar(h,'Task','9/21/2006','9/21/2006',Null,Null); ItemBar[h,'',EXG2ANTTLib_TLB.exBarEndInclusive] := '9/25/2006'; ItemBar[h,'',EXG2ANTTLib_TLB.exBarKeepWorkingCount] := OleVariant(True); end; EndUpdate(); end |
1496 |
How can I display the end date to be the last visible date of task, instead the next day
// BarResize event - Occurs when a bar is moved or resized. procedure TForm1.G2antt1BarResize(ASender: TObject; Item : HITEM;Key : OleVariant); begin with G2antt1 do begin Items.SchedulePDM(Item,OleVariant(Key)); end end; // BarResizing event - Occurs when a bar is moving or resizing. procedure TForm1.G2antt1BarResizing(ASender: TObject; Item : HITEM;Key : OleVariant); begin with G2antt1 do begin Items.SchedulePDM(Item,OleVariant(Key)); end end; with G2antt1 do begin BeginUpdate(); MarkSearchColumn := False; HeaderHeight := 36; with Columns do begin Add('Tasks'); (IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1); with (IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column) do begin HTMLCaption := '<b>End</b><br>Inclusive'; Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(543); Editor.EditType := EXG2ANTTLib_TLB.DateType; end; (IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2); end; with ConditionalFormats.Add(1,Null) do begin Bold := True; ApplyTo := EXG2ANTTLib_TLB.FormatApplyToEnum($2); end; with Chart do begin FirstVisibleDate := '9/20/2006'; LevelCount := 2; PaneWidth[False] := 256; Bars.Add('Task:Split').Shortcut := 'Task'; end; with Items do begin AllowCellValueToItemBar := True; h1 := AddItem('Task 1'); AddBar(h1,'Task','9/21/2006','9/23/2006',Null,Null); h2 := AddItem('Task 2'); AddBar(h2,'Task','9/21/2006','9/26/2006',Null,Null); AddLink('link',h1,'',h2,''); ItemBar[0,'<*>',EXG2ANTTLib_TLB.exBarKeepWorkingCount] := OleVariant(True); SchedulePDM(0,''); end; EndUpdate(); end |
1495 |
How do I hide the selection
with G2antt1 do begin BeginUpdate(); MarkSearchColumn := False; SelForeColor := ForeColor; SelBackColor := BackColor; ShowFocusRect := False; with Columns do begin with (IUnknown(Add('Format')) as EXG2ANTTLib_TLB.Column) do begin FormatColumn := 'type(value) in (0,1) ? ''null'' : ( dbl(value)<0 ? ''<fgcolor=FF0000>''+ (value format ''2|.|3|,|1'' ) : (dbl(value)>0 ? ''<fgcolor=000' + '0FF>+''+(value format ''2|.|3|,'' ): ''0.00'') )'; Def[EXG2ANTTLib_TLB.exCellValueFormat] := OleVariant(1); end; end; with Items do begin AddItem(OleVariant(10)); AddItem(OleVariant(-8)); end; EndUpdate(); end |
1494 |
How do I access the cells, or how do I get the values in the columns
with G2antt1 do begin with Columns do begin Add('C1'); Add('C2'); Add('C3'); end; with Items do begin h := AddItem('Item 1'); CellValue[OleVariant(h),OleVariant(1)] := 'SubItem 1.1'; CellValue[OleVariant(h),OleVariant(2)] := 'SubItem 1.2'; OutputDebugString( CellValue[OleVariant(h),OleVariant(1)] ); end; end |
1493 |
Is there any function I can use to indicate the Now() when using the ComputedFields, CondtionalFormats, ...
with G2antt1 do begin (IUnknown(Columns.Add('Now')) as EXG2ANTTLib_TLB.Column).ComputedField := 'date(``)'; Items.AddItem(''); end |
1492 |
How can I get the start and end points of the bar once the BarResize event occurs
// BarResize event - Occurs when a bar is moved or resized. procedure TForm1.G2antt1BarResize(ASender: TObject; Item : HITEM;Key : OleVariant); begin with G2antt1 do begin OutputDebugString( 'Start: ' ); OutputDebugString( Items.ItemBar[Item,OleVariant(Key),EXG2ANTTLib_TLB.exBarStart] ); OutputDebugString( 'End: ' ); OutputDebugString( Items.ItemBar[Item,OleVariant(Key),EXG2ANTTLib_TLB.exBarEnd] ); end end; with G2antt1 do begin BeginUpdate(); with Chart do begin FirstVisibleDate := '12/31/2009'; LevelCount := 2; PaneWidth[False] := 96; var_Bar := Bars.Item['Task']; end; Columns.Add('Types'); with Items do begin AddBar(AddItem('Task 1'),'Task','1/4/2010','1/9/2010','',Null); AddBar(AddItem('Task 2'),'Task','1/4/2010','1/9/2010','',Null); end; EndUpdate(); end |
1491 |
My chart displays hours, the question would be if possible to let user resizes the bars up to 1/2 hour, or a half an hour
with G2antt1 do begin BeginUpdate(); DefaultItemHeight := 22; Columns.Add('Task'); with Chart do begin AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarAuto; LevelCount := 2; UnitScale := EXG2ANTTLib_TLB.exHour; ResizeUnitScale := EXG2ANTTLib_TLB.exMinute; ResizeUnitCount := 30; PaneWidth[False] := 48; FirstVisibleDate := '1/1/2001'; DrawGridLines := EXG2ANTTLib_TLB.exAllLines; Level[1].DrawGridLines := True; end; with Items do begin AddItem('Task'); AddItem('Task'); AddItem('Task'); AddItem('Task'); AddItem('Task'); end; EndUpdate(); end |
1490 |
How can I show the dates in the title
|
1489 |
If I vertically scroll the control the image flows fluently. But when I scroll on the horizontal chart's scrollbar the images only shows after I release the click button. Can I make it scroll fluently like the vertical scrollbar
with G2antt1 do begin Chart.PaneWidth[False] := 0; Chart.ToolTip := ''; end |
1488 |
How can I programmatically add a bar during the CreateBar event
// CreateBar event - Fired when the user creates a new bar. procedure TForm1.G2antt1CreateBar(ASender: TObject; Item : HITEM;DateStart : TDateTime;DateEnd : TDateTime); begin with G2antt1 do begin with Items do begin k := ItemBar[Item,'',EXG2ANTTLib_TLB.exBarsCount]; AddBar(Item,'Order',OleVariant(DateStart),OleVariant(DateEnd),OleVariant(k),'your text'); end; OutputDebugString( Items.ItemBar[Item,'',EXG2ANTTLib_TLB.exBarsCount] ); end end; with G2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarManual; PaneWidth[False] := 48; FirstVisibleDate := '12/28/2000'; LevelCount := 2; Bars.Copy('Task','Order'); end; with Items do begin AddItem(OleVariant(1)); AddItem(OleVariant(2)); AddItem(OleVariant(3)); end; EndUpdate(); end |
1487 |
How can I move more bars by code
with G2antt1 do begin Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '1/1/2001'; LevelCount := 2; PaneWidth[False] := 48; end; with Items do begin AddBar(AddItem('Task 1'),'Task','1/1/2001','1/6/2001','A',Null); AddBar(AddItem('Task 2'),'Task','1/2/2001','1/7/2001','B',Null); ItemBar[0,'<*>',EXG2ANTTLib_TLB.exBarMove] := OleVariant(1); ItemBar[0,'<A*>',EXG2ANTTLib_TLB.exBarMove] := OleVariant(1); ItemBar[0,'<B*>',EXG2ANTTLib_TLB.exBarMove] := OleVariant(1); end; end |
1486 |
How can I move a bar by code
with G2antt1 do begin Columns.Add('Tasks'); with Chart do begin FirstVisibleDate := '1/1/2001'; LevelCount := 2; PaneWidth[False] := 48; end; with Items do begin h := AddItem('Task 1'); AddBar(h,'Task','1/1/2001','1/6/2001','A',Null); ItemBar[h,'A',EXG2ANTTLib_TLB.exBarMove] := OleVariant(1); end; end |
1485 |
How can I clip the notes to the items zone only
with G2antt1 do begin BeginUpdate(); Images('gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTql' + 'Vq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0' + 'ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yN' + 'AOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA='); AntiAliasing := True; Columns.Add('Task'); with Chart do begin FirstVisibleDate := '1/1/2001'; PaneWidth[False] := 96; LevelCount := 2; end; with Items do begin AddItem(Null); h := AddItem('Task 1'); AddBar(h,'Task','1/5/2001','1/8/2001','1',Null); end; with Chart.Notes do begin with Add('1',OleVariant(G2antt1.Items.ItemByIndex[1]),'1','<img>2</img>') do begin PartShadow[EXG2ANTTLib_TLB.exNoteEnd] := False; PartBorderSize[EXG2ANTTLib_TLB.exNoteEnd] := 0; ClearPartBackColor(EXG2ANTTLib_TLB.exNoteEnd); PartCanMove[EXG2ANTTLib_TLB.exNoteEnd] := True; RelativePosition := OleVariant(0.5); PartVOffset[EXG2ANTTLib_TLB.exNoteEnd] := -36; end; ClipTo := EXG2ANTTLib_TLB.exNotesClipToItems; end; EndUpdate(); end |
1484 |
How can I put two bars of various types, in the event of conflict do not coincide
with G2antt1 do begin BeginUpdate(); DefaultItemHeight := 22; Columns.Add('Task'); ScrollBySingleLine := True; BackColorAlternate := RGB(240,240,240); with Chart do begin PaneWidth[False] := 48; FirstVisibleDate := '12/28/2000'; LevelCount := 2; with Bars.Item['Task'] do begin OverlaidType := Integer(EXG2ANTTLib_TLB.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsStack); OverlaidGroup := 'NewTask'; end; with Bars.Copy('Task','NewTask') do begin OverlaidType := Integer(EXG2ANTTLib_TLB.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsStack); OverlaidGroup := 'Task'; Color := $ff; end; end; with Items do begin h1 := AddItem('Default'); h := AddItem('Overlaid'); AddBar(h,'Task','1/2/2001','1/4/2001','A1','A1'); AddBar(h,'NewTask','1/3/2001','1/5/2001','A2','A2'); AddBar(h,'NewTask','1/4/2001','1/7/2001','A3','A3'); AddBar(h,'Task','1/4/2001','1/7/2001','A4','A4'); h1 := AddItem('Default'); end; EndUpdate(); end |
1483 |
How can I run trigger an event which, after clicking on the item/bar gives the key/name or item id
// MouseDown event - Occurs when the user presses a mouse button. procedure TForm1.G2antt1MouseDown(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer); begin with G2antt1 do begin item := ItemFromPoint[-1,-1,column,hit]; key := Chart.BarFromPoint[-1,-1]; OutputDebugString( 'Item:' ); OutputDebugString( item ); OutputDebugString( 'Key:' ); OutputDebugString( key ); OutputDebugString( 'CellValue(i,0):' ); OutputDebugString( Items.CellValue[OleVariant(item),OleVariant(0)] ); Items.ItemBar[item,OleVariant(key),EXG2ANTTLib_TLB.exBarColor] := OleVariant(255); end end; with G2antt1 do begin BeginUpdate(); Columns.Add('Task'); with Chart do begin FirstVisibleDate := '12/29/2000'; PaneWidth[False] := 64; LevelCount := 2; end; with Items do begin h1 := AddItem('Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null); h2 := AddItem('Task 2'); AddBar(h2,'Task','1/4/2001','1/6/2001','K2',Null); AddLink('L1',h1,'K1',h2,'K2'); h3 := AddItem('Task 3'); AddBar(h3,'Task','1/8/2001','1/10/2001','K3',Null); AddLink('L2',h2,'K2',h3,'K3'); end; EndUpdate(); end |
1482 |
How can I change the check-boxes appearance
with G2antt1 do begin LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot; with (IUnknown(Columns.Add('Default')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellHasCheckBox] := OleVariant(True); PartialCheck := True; end; with Items do begin h := AddItem('Root'); InsertItem(h,Null,'Child 1'); InsertItem(h,Null,'Child 2'); ExpandItem[h] := True; end; with VisualAppearance do begin Add(1,'XP:Button 3 12'); Add(2,'XP:Button 3 11'); Add(3,'XP:Button 3 10'); end; CheckImage[EXG2ANTTLib_TLB.Unchecked] := 16777216; CheckImage[EXG2ANTTLib_TLB.Checked] := 33554432; CheckImage[EXG2ANTTLib_TLB.PartialChecked] := 50331648; end |
1481 |
How can I change the color for the control's split bar (sample 1)
with G2antt1 do begin BeginUpdate(); Columns.Add('Default'); Background[EXG2ANTTLib_TLB.exSplitBar] := $10000; BackColorLevelHeader := BackColor; with Chart do begin LevelCount := 2; PaneWidth[False] := 64; HistogramVisible := True; HistogramHeight := 64; OverviewHeight := 48; OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAll; end; EndUpdate(); end |
1480 |
Is it possible to display ONLY the working hours
with G2antt1 do begin with Chart do begin FirstVisibleDate := '1/1/2001'; LevelCount := 2; with Level[0] do begin Label := OleVariant(4096); Alignment := Integer(EXG2ANTTLib_TLB.exHOutside) Or Integer(EXG2ANTTLib_TLB.CenterAlignment); end; with Level[1] do begin Label := '<%hh%>'; Count := 6; end; UnitWidth := 26; PaneWidth[False] := 0; NonworkingHours := 15728895; ShowNonworkingUnits := False; ShowNonworkingHours := False; end; end |
1479 |
How can I display the end of the day in the chart's header
with G2antt1 do begin with Chart do begin FirstVisibleDate := '1/1/2001'; LevelCount := 2; with Level[0] do begin Label := OleVariant(4096); Alignment := Integer(EXG2ANTTLib_TLB.exHOutside) Or Integer(EXG2ANTTLib_TLB.CenterAlignment); end; with Level[1] do begin Label := '<%hh%>'; Count := 6; ReplaceLabel['08'] := '<b>8</b> <font ;6>am'; ReplaceLabel['14'] := '<b>8</b> <font ;6>pm'; end; UnitWidth := 26; PaneWidth[False] := 0; NonworkingHours := 15728895; ShowNonworkingUnits := False; ShowNonworkingHours := False; end; end |
1478 |
How can I display the +/- expanding buttons in the chart section
with G2antt1 do begin BeginUpdate(); LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot; Indent := 13; HasButtons := EXG2ANTTLib_TLB.exWPlus; with Chart do begin FirstVisibleDate := '12/25/2010'; LevelCount := 2; PaneWidth[False] := 0; ColumnsFormatLevel := '0'; SelBackColor := G2antt1.SelBackColor; SelForeColor := G2antt1.SelForeColor; end; with (IUnknown(Columns.Add('P1')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellHasCheckBox] := OleVariant(True); PartialCheck := True; end; with Items do begin h := AddItem('Root'); AddBar(InsertItem(h,Null,'Child 1'),'Task','1/2/2011','1/5/2011',Null,Null); AddBar(InsertItem(h,Null,'Child 2'),'Task','1/4/2011','1/7/2011',Null,Null); AddBar(InsertItem(h,Null,'Child 3'),'Task','1/7/2011','1/8/2011',Null,Null); ExpandItem[h] := True; end; EndUpdate(); end |
1477 |
Is it possible to display the columns in the chart aligned to the right
with G2antt1 do begin BeginUpdate(); DefaultItemHeight := 24; Columns.Add('Tasks'); with (IUnknown(Columns.Add('Key')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(0); Visible := False; Alignment := EXG2ANTTLib_TLB.RightAlignment; end; with Chart do begin FirstVisibleDate := '12/30/2000'; LevelCount := 2; PaneWidth[False] := 0; ColumnsFormatLevel := '|,1:52'; end; with Items do begin AllowCellValueToItemBar := True; AddBar(AddItem('Task 1'),'Task','1/3/2001','1/7/2001',Null,Null); AddBar(AddItem('Task 2'),'Split','1/3/2001','1/7/2001',Null,Null); AddBar(AddItem('Task 3'),'Progress','1/3/2001','1/7/2001',Null,Null); end; EndUpdate(); end |
1476 |
How can I display a border in the chart
with G2antt1 do begin BeginUpdate(); DefaultItemHeight := 24; Columns.Add('Tasks'); with (IUnknown(Columns.Add('Key')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(0); Visible := False; Alignment := EXG2ANTTLib_TLB.CenterAlignment; Def[EXG2ANTTLib_TLB.exCellForeColor] := OleVariant(255); end; with Chart do begin FirstVisibleDate := '12/30/2000'; LevelCount := 2; PaneWidth[False] := 0; ColumnsFormatLevel := '1:52,\"\"[bg=255]:2'; end; with Items do begin AllowCellValueToItemBar := True; AddBar(AddItem('Task 1'),'Task','1/3/2001','1/7/2001',Null,Null); AddBar(AddItem('Task 2'),'Split','1/3/2001','1/7/2001',Null,Null); AddBar(AddItem('Task 3'),'Progress','1/3/2001','1/7/2001',Null,Null); end; EndUpdate(); end |
1475 |
How can I change the font to display the columns in the chart (Method 2)
with G2antt1 do begin BeginUpdate(); DefaultItemHeight := 24; Columns.Add('Tasks'); with (IUnknown(Columns.Add('Key')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(0); Visible := False; end; with ConditionalFormats.Add(1,Null) do begin Bold := True; ApplyTo := EXG2ANTTLib_TLB.FormatApplyToEnum($1); end; with Chart do begin FirstVisibleDate := '12/30/2000'; LevelCount := 2; PaneWidth[False] := 48; ColumnsFormatLevel := '1'; end; with Items do begin AllowCellValueToItemBar := True; AddBar(AddItem('Task 1'),'Task','1/3/2001','1/7/2001',Null,Null); AddBar(AddItem('Task 2'),'Split','1/3/2001','1/7/2001',Null,Null); AddBar(AddItem('Task 3'),'Progress','1/3/2001','1/7/2001',Null,Null); end; EndUpdate(); end |
1474 |
How can I change the font to display the columns in the chart (Method 1)
with G2antt1 do begin BeginUpdate(); DefaultItemHeight := 24; Columns.Add('Tasks'); with (IUnknown(Columns.Add('Key')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(0); Visible := False; end; with Chart do begin FirstVisibleDate := '12/30/2000'; LevelCount := 2; PaneWidth[False] := 48; ColumnsFormatLevel := '1'; ColumnsFont := (IUnknown(G2antt1.Font) as stdole_TLB.StdFont); with ColumnsFont do begin Size := 12; Name := 'Tahoma'; end; end; with Items do begin AllowCellValueToItemBar := True; AddBar(AddItem('Task 1'),'Task','1/3/2001','1/7/2001',Null,Null); AddBar(AddItem('Task 2'),'Split','1/3/2001','1/7/2001',Null,Null); AddBar(AddItem('Task 3'),'Progress','1/3/2001','1/7/2001',Null,Null); end; EndUpdate(); end |
1473 |
How can I change the column's background color when it is displayed on the chart (Method 2)
with G2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with (IUnknown(Columns.Add('Key')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(0); Visible := False; end; with Chart do begin FirstVisibleDate := '12/30/2000'; LevelCount := 2; PaneWidth[False] := 48; ColumnsFormatLevel := '1[bg=255]:52'; end; with Items do begin AllowCellValueToItemBar := True; AddBar(AddItem('Task 1'),'Task','1/3/2001','1/7/2001',Null,Null); AddBar(AddItem('Task 2'),'Split','1/3/2001','1/7/2001',Null,Null); AddBar(AddItem('Task 3'),'Progress','1/3/2001','1/7/2001',Null,Null); end; EndUpdate(); end |
1472 |
How can I change the column's background color when it is displayed on the chart (Method 1)
with G2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with (IUnknown(Columns.Add('Key')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(0); Visible := False; Def[EXG2ANTTLib_TLB.exCellBackColor] := OleVariant(15790320); end; with Chart do begin FirstVisibleDate := '12/30/2000'; LevelCount := 2; PaneWidth[False] := 48; ColumnsFormatLevel := '1:52'; end; with Items do begin AllowCellValueToItemBar := True; AddBar(AddItem('Task 1'),'Task','1/3/2001','1/7/2001',Null,Null); AddBar(AddItem('Task 2'),'Split','1/3/2001','1/7/2001',Null,Null); AddBar(AddItem('Task 3'),'Progress','1/3/2001','1/7/2001',Null,Null); end; EndUpdate(); end |
1471 |
Can the chart display any column
with G2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with (IUnknown(Columns.Add('Start')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1); Visible := False; Alignment := EXG2ANTTLib_TLB.LeftAlignment; end; with (IUnknown(Columns.Add('End')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2); Visible := False; Alignment := EXG2ANTTLib_TLB.RightAlignment; end; with Chart do begin FirstVisibleDate := '1/1/2001'; LevelCount := 2; PaneWidth[False] := 48; ColumnsFormatLevel := '1:52,|,2:52'; end; with Items do begin AllowCellValueToItemBar := True; AddBar(AddItem('Task 1'),'Task','1/3/2001','1/7/2001',Null,Null); AddBar(AddItem('Task 2'),'Task','1/4/2001','1/8/2001',Null,Null); end; EndUpdate(); end |
1470 |
Is it possible to display a check-box column on the chart
with G2antt1 do begin Columns.Add('Tasks'); with (IUnknown(Columns.Add('Check')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellHasCheckBox] := OleVariant(True); Visible := False; end; with Chart do begin FirstVisibleDate := '1/1/2001'; LevelCount := 2; PaneWidth[False] := 48; ColumnsFormatLevel := '1'; end; with Items do begin AddBar(AddItem('Task 1'),'Task','1/3/2001','1/7/2001',Null,Null); AddBar(AddItem('Task 2'),'Task','1/4/2001','1/8/2001',Null,Null); end; end |
1469 |
Is it possible to disable the cell's editor context menu
with G2antt1 do begin with (IUnknown(Columns.Add('Edit')) as EXG2ANTTLib_TLB.Column).Editor do begin EditType := EXG2ANTTLib_TLB.EditType; Option[EXG2ANTTLib_TLB.exEditAllowContextMenu] := OleVariant(False); end; with Items do begin AddItem(OleVariant(10)); AddItem(OleVariant(20)); end; end |
1468 |
How can I find a value in a drop down editor
with G2antt1 do begin with (IUnknown(Columns.Add('DropDownList')) as EXG2ANTTLib_TLB.Column).Editor do begin EditType := EXG2ANTTLib_TLB.DropDownListType; AddItem(1,'DDList 1',Null); AddItem(2,'DDList 2',Null); AddItem(3,'DDList 3',Null); end; with (IUnknown(Columns.Add('DropDown')) as EXG2ANTTLib_TLB.Column).Editor do begin EditType := EXG2ANTTLib_TLB.DropDownType; AddItem(1,'DDType 1',Null); AddItem(2,'DDType 2',Null); AddItem(3,'DDType 3',Null); end; with Items do begin CellValue[OleVariant(.AddItem(OleVariant(1))),OleVariant(1)] := G2antt1.Columns.Item[OleVariant(1)].Editor.FindItem[OleVariant(1)]; CellValue[OleVariant(.AddItem(OleVariant(2))),OleVariant(1)] := G2antt1.Columns.Item[OleVariant(1)].Editor.FindItem[OleVariant(2)]; end; end |
1467 |
What is the difference between DropDownType and DropDownListType
with G2antt1 do begin with (IUnknown(Columns.Add('DropDownList')) as EXG2ANTTLib_TLB.Column).Editor do begin EditType := EXG2ANTTLib_TLB.DropDownListType; AddItem(1,'First item',Null); AddItem(2,'Second item',Null); AddItem(3,'Third item',Null); end; with (IUnknown(Columns.Add('DropDown')) as EXG2ANTTLib_TLB.Column).Editor do begin EditType := EXG2ANTTLib_TLB.DropDownType; AddItem(1,'First item',Null); AddItem(2,'Second item',Null); AddItem(3,'Third item',Null); end; with Items do begin CellValue[OleVariant(AddItem(OleVariant(1))),OleVariant(1)] := 'Any'; CellValue[OleVariant(AddItem(OleVariant(2))),OleVariant(1)] := 'Any'; end; end |
1466 |
How can I mark or enlarge the selected bars, so I have a clear frame around (Method 3)
with G2antt1 do begin BeginUpdate(); DefaultItemHeight := 32; with VisualAppearance do begin Add(1,'c:\exontrol\images\normal.ebn'); Add(2,'CP:1 -2 -2 2 2'); end; with Chart do begin PaneWidth[False] := 48; FirstVisibleDate := '1/1/2002'; SelBarColor := $2ff0000; Bars.Item['Task'].Color := $1000000; end; Columns.Add('Task'); with Items do begin h := AddItem('Task 1'); AddBar(h,'Task','1/2/2002','1/4/2002','A',Null); AddBar(h,'Task','1/6/2002','1/10/2002','B',Null); AddBar(h,'Task','1/11/2002','1/14/2002','C',Null); ItemBar[h,'A',EXG2ANTTLib_TLB.exBarSelected] := OleVariant(True); ItemBar[h,'B',EXG2ANTTLib_TLB.exBarSelected] := OleVariant(True); end; EndUpdate(); end |
1465 |
How can I mark or enlarge the selected bars, so I have a clear frame around (Method 2)
with G2antt1 do begin BeginUpdate(); DefaultItemHeight := 32; with VisualAppearance do begin Add(1,'c:\exontrol\images\normal.ebn'); Add(2,'CP:1 -2 -2 2 2'); end; with Chart do begin PaneWidth[False] := 48; FirstVisibleDate := '1/1/2002'; SelBarColor := $2000000; Bars.Item['Task'].Color := $1000000; end; Columns.Add('Task'); with Items do begin h := AddItem('Task 1'); AddBar(h,'Task','1/2/2002','1/4/2002','A',Null); AddBar(h,'Task','1/6/2002','1/10/2002','B',Null); AddBar(h,'Task','1/11/2002','1/14/2002','C',Null); ItemBar[h,'A',EXG2ANTTLib_TLB.exBarSelected] := OleVariant(True); ItemBar[h,'B',EXG2ANTTLib_TLB.exBarSelected] := OleVariant(True); end; EndUpdate(); end |
1464 |
How can I mark or enlarge the selected bars, so I have a clear frame around (Method 1)
with G2antt1 do begin BeginUpdate(); DefaultItemHeight := 32; with VisualAppearance do begin Add(1,'gBFLBCJwBAEHhEJAEGg4BNkMQAAYAQGKIYBkAKBQAGaAoDDYNQwQwAAwjIKEEwsACEIrjKCVIgkHYJRjGEZxMAsEwjAoaQChEZRUhEMgxDDIIxAJIcaw0GSEZwgOQZBi' + 'OEYnDANMgzDLMZR7DajYymSA6LiKNo+QjKFB0NLMVRtEIIIzCSCaNomT4DS4NIi2DYcVhhMqBYbtCZZBo2FpZUxXdL0BJMVxbHKYJikW4pVjoAJ+TxccjVDQNJyLQ6rY' + 'zuAAKNpuO58RbdGDQHA9KyfLCEcTxYAMbp6X5kaBZVp2VCMRzbTLUIDzPNVCTrNIaJioAaMeiCG5NUzieqRNalLABFjZMIHDbtGynDIJZruW52+CLIZpWbEOiRXr2Txx' + 'gGYp5Fie5mAYBgIgSFDrDOIZUmQZYiECXJUjIEQ3lUGgbEIRQcg+Hg8DEFxYFuOR/i+X5znufh/omBgCgCVwjn4BoBmCCAmAqApgkefgMgOYQID4DoELsUgTgUYYIC4F' + '4GGGSAaBuBxhhgfgggUYgog4EYJGIaBJn6ChiBiLgsgkIpoj4J4BCMSJWDaDZjgiZgCEAQCAgA=='); Add(2,'CP:1 -2 -2 2 2'); end; with Chart do begin FirstVisibleDate := '1/1/2002'; SelBarColor := $2000000; PaneWidth[False] := 48; end; Columns.Add('Task'); with Items do begin h := AddItem('Task 1'); AddBar(h,'Task','1/2/2002','1/4/2002','A',Null); AddBar(h,'Task','1/6/2002','1/10/2002','B',Null); AddBar(h,'Task','1/11/2002','1/14/2002','C',Null); ItemBar[h,'A',EXG2ANTTLib_TLB.exBarSelected] := OleVariant(True); ItemBar[h,'B',EXG2ANTTLib_TLB.exBarSelected] := OleVariant(True); end; EndUpdate(); end |
1463 |
How can I load my table from an Access 2007, using ADO
// AddItem event - Occurs after a new Item has been inserted to Items collection. procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM); begin with G2antt1 do begin with Items do begin AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null); end; end end; with G2antt1 do begin BeginUpdate(); with Chart do begin FirstVisibleDate := '8/3/1994'; PaneWidth[False] := 256; LevelCount := 2; UnitScale := EXG2ANTTLib_TLB.exDay; FirstWeekDay := EXG2ANTTLib_TLB.exMonday; OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible; end; ColumnAutoResize := False; ContinueColumnScroll := False; rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset); with rs do begin Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null); end; DataSource := (IUnknown(rs) as ADODB_TLB.Recordset); Items.AllowCellValueToItemBar := True; Columns.Item[OleVariant(2)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1); Columns.Item[OleVariant(4)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2); EndUpdate(); end |
1462 |
Is it possible to enumerate the links without enumerating them
with G2antt1 do begin AntiAliasing := True; Columns.Add('Task'); with Chart do begin FirstVisibleDate := '1/1/2001'; PaneWidth[False] := 128; NonworkingDays := 0; LinksWidth := 2; end; with Items do begin h1 := AddItem('Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null); h2 := AddItem('Task 2'); AddBar(h2,'Task','1/6/2001','1/8/2001','K2',Null); AddLink('L1',h1,'K1',h2,'K2'); h3 := AddItem('Task 3'); AddBar(h3,'Task','1/10/2001','1/12/2001','K3',Null); AddLink('L2',h2,'K2',h3,'K3'); h4 := AddItem('Task 4'); AddBar(h4,'Task','1/14/2001','1/16/2001','K4',Null); AddLink('L3',h3,'K3',h4,'K4'); Link['<L*>',EXG2ANTTLib_TLB.exLinkShowDir] := OleVariant(False); end; end |
1461 |
How can I display a vertical line in the chart
// Click event - Occurs when the user presses and then releases the left mouse button over the tree control. procedure TForm1.G2antt1Click(ASender: TObject; ); begin with G2antt1 do begin with Chart do begin MarkNowColor := $ff; MarkNow := OleVariant(DateFromPoint[-1,-1]); end; end end; with G2antt1 do begin with Chart do begin FirstVisibleDate := '3/13/2012'; PaneWidth[False] := 0; LevelCount := 2; MarkNowColor := $0; MarkNowWidth := 3; UnitWidth := 32; ResizeUnitScale := EXG2ANTTLib_TLB.exHour; end; end |
1460 |
How can I use the MarkNowColor to mark a time line different then the time on the machine
with G2antt1 do begin with Chart do begin FirstVisibleDate := '3/13/2012'; PaneWidth[False] := 0; LevelCount := 2; Level[0].Label := OleVariant(1048576); with Level[1] do begin Label := '<%ss%>'; Count := 15; end; MarkNowColor := $ff; MarkNowWidth := 3; MarkNow := '3/13/2012 12:03:20 AM'; end; end |
1459 |
Is it possible to show the current date time using a delay
with G2antt1 do begin with Chart do begin PaneWidth[False] := 0; LevelCount := 2; Level[0].Label := OleVariant(1048576); with Level[1] do begin Label := '<%ss%>'; Count := 15; end; MarkNowColor := $ff0000; MarkNowWidth := 3; MarkNowDelay := 0.00069444; end; Columns.Add('Tasks'); with Items do begin AddBar(AddItem('Item 1'),'Task','1/1/2008','1/1/2018',Null,Null); end; end |
1458 |
What are the options to show the links between bars
with G2antt1 do begin AntiAliasing := True; Columns.Add('Task'); with Chart do begin FirstVisibleDate := '1/1/2001'; PaneWidth[False] := 128; NonworkingDays := 0; LinksWidth := 2; end; with Items do begin h1 := AddItem('Task 1'); AddItem(''); AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null); h2 := AddItem('Task 2'); AddItem(''); AddBar(h2,'Task','1/6/2001','1/8/2001','K2',Null); AddLink('L1',h1,'K1',h2,'K2'); h3 := AddItem('Task 3'); AddItem(''); AddBar(h3,'Task','1/12/2001','1/14/2001','K3',Null); AddLink('L2',h2,'K2',h3,'K3'); Link['L2',EXG2ANTTLib_TLB.exLinkShowRound] := OleVariant(-1); h4 := AddItem('Task 4'); AddBar(h4,'Task','1/18/2001','1/20/2001','K4',Null); AddLink('L3',h3,'K3',h4,'K4'); Link['L3',EXG2ANTTLib_TLB.exLinkShowRound] := OleVariant(1); AddItem(''); h5 := AddItem('Task 5'); AddBar(h5,'Task','1/22/2001','1/24/2001','K5',Null); AddLink('L4',h4,'K4',h5,'K5'); Link['L4',EXG2ANTTLib_TLB.exLinkShowRound] := OleVariant(2); end; end |
1457 |
Is it possible to specify the link between bars to be a wider line
with G2antt1 do begin Columns.Add('Task'); with Chart do begin FirstVisibleDate := '1/1/2001'; PaneWidth[False] := 128; NonworkingDays := 0; LinksStyle := EXG2ANTTLib_TLB.exLinkSolid; LinksWidth := 2; LinksColor := $ff; end; with Items do begin h1 := AddItem('Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null); h2 := AddItem('Task 2'); AddBar(h2,'Task','1/6/2001','1/8/2001','K2',Null); AddLink('L1',h1,'K1',h2,'K2'); h3 := AddItem('Task 3'); AddBar(h3,'Task','1/10/2001','1/12/2001','K3',Null); AddLink('L2',h2,'K2',h3,'K3'); end; end |
1456 |
Is it possible to create a link between the two specified bars so that the link was a straight line
with G2antt1 do begin Columns.Add('Task'); AntiAliasing := True; with Chart do begin FirstVisibleDate := '1/1/2001'; PaneWidth[False] := 128; NonworkingDays := 0; end; with Items do begin h1 := AddItem('Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null); h2 := AddItem('Task 2'); AddBar(h2,'Task','1/6/2001','1/8/2001','K2',Null); AddLink('L1',h1,'K1',h2,'K2'); Link['L1',EXG2ANTTLib_TLB.exLinkStyle] := OleVariant(0); Link['L1',EXG2ANTTLib_TLB.exLinkWidth] := OleVariant(2); Link['L1',EXG2ANTTLib_TLB.exLinkColor] := OleVariant(255); Link['L1',EXG2ANTTLib_TLB.exLinkShowRound] := OleVariant(2); h3 := AddItem('Task 3'); AddBar(h3,'Task','1/10/2001','1/12/2001','K3',Null); AddLink('L2',h2,'K2',h3,'K3'); end; end |
1455 |
I associate the bars with my columns, Start and End, but can not get it working for bars with non-empty keys. What am I doing wrong
with G2antt1 do begin BeginUpdate(); with Columns do begin Add('Tasks'); with (IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1); Def[EXG2ANTTLib_TLB.exCellValueToItemBarKey] := 'A'; end; with (IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2); Def[EXG2ANTTLib_TLB.exCellValueToItemBarKey] := 'A'; end; end; Items.AllowCellValueToItemBar := True; with Chart do begin PaneWidth[False] := 256; FirstVisibleDate := '1/1/2002'; LevelCount := 2; Bars.Item['Task'].OverlaidType := EXG2ANTTLib_TLB.exOverlaidBarsStack; end; with Items do begin AddBar(AddItem('Task 1'),'Task','1/4/2002','1/8/2002','A','A'); h := AddItem('Task 2'); AddBar(h,'Task','1/6/2002','1/10/2002','A','A'); AddBar(h,'Task','1/4/2002','1/8/2002','B','B'); ItemBar[h,'B',EXG2ANTTLib_TLB.exBarColor] := OleVariant(255); end; EndUpdate(); end |
1454 |
The right pane needs to show ONLY the hours 6am to 9pm (every hour) for one day only and the user should not to be able to scroll left or right nor see any other hours. How can I do that
with G2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin LevelCount := 2; ScrollRange[EXG2ANTTLib_TLB.exStartDate] := '1/1/2001'; ScrollRange[EXG2ANTTLib_TLB.exEndDate] := '1/1/2001'; UnitScale := EXG2ANTTLib_TLB.exHour; NonworkingHours := 12582975; ShowNonworkingUnits := False; ShowNonworkingHours := False; Level[0].Alignment := Integer(EXG2ANTTLib_TLB.exHOutside) Or Integer(EXG2ANTTLib_TLB.CenterAlignment); UnitWidth := 18; PaneWidth[True] := 294; ScrollBar := False; end; OnResizeControl := EXG2ANTTLib_TLB.exDisableSplitter; EndUpdate(); end |
1453 |
Is it possible to count only a specified type of bars without enumerating them
with G2antt1 do begin Columns.Add('Tasks'); Chart.FirstVisibleDate := '1/1/2001'; with Items do begin AddBar(AddItem('Task 1'),'Task','1/2/2001','1/4/2001','K1','K1'); AddBar(AddItem('Task 2'),'Progress','1/3/2001','1/5/2001',Null,Null); AddBar(AddItem('Task 3'),'Task','1/2/2001','1/4/2001','P3','P3'); OutputDebugString( 'K*' ); OutputDebugString( ItemBar[0,'<K*>',EXG2ANTTLib_TLB.exBarsCount] ); OutputDebugString( 'K* P*' ); OutputDebugString( ItemBar[0,'<K* P*>',EXG2ANTTLib_TLB.exBarsCount] ); end; end |
1452 |
How can I count or get the numbers of the bars in the chart
with G2antt1 do begin Columns.Add('Tasks'); Chart.FirstVisibleDate := '1/1/2001'; with Items do begin AddBar(AddItem('Task 1'),'Task','1/2/2001','1/4/2001','K1','K1'); AddBar(AddItem('Task 2'),'Task','1/2/2001','1/4/2001','A2','A2'); AddBar(AddItem('Task 3'),'Task','1/2/2001','1/4/2001','K3','K3'); OutputDebugString( 'All' ); OutputDebugString( ItemBar[0,'<*>',EXG2ANTTLib_TLB.exBarsCount] ); OutputDebugString( 'A*' ); OutputDebugString( ItemBar[0,'<A*>',EXG2ANTTLib_TLB.exBarsCount] ); OutputDebugString( 'K*' ); OutputDebugString( ItemBar[0,'<K*>',EXG2ANTTLib_TLB.exBarsCount] ); end; end |
1451 |
Is it possible to remove only specified bars from ALL items at once
with G2antt1 do begin Columns.Add('Tasks'); Chart.FirstVisibleDate := '1/1/2001'; with Items do begin AddBar(AddItem('Task 1'),'Task','1/2/2001','1/4/2001','K1','K1'); AddBar(AddItem('Task 2'),'Task','1/2/2001','1/4/2001','A2','A2'); AddBar(AddItem('Task 3'),'Task','1/2/2001','1/4/2001','K3','K3'); RemoveBar(0,'<K*>'); end; end |
1450 |
How can I remove all bars from the chart (method 2)
with G2antt1 do begin Columns.Add('Tasks'); Chart.FirstVisibleDate := '1/1/2001'; with Items do begin AddBar(AddItem('Task 1'),'Task','1/2/2001','1/4/2001','K1','K1'); AddBar(AddItem('Task 2'),'Task','1/2/2001','1/4/2001','A2','A2'); AddBar(AddItem('Task 3'),'Task','1/2/2001','1/4/2001','K3','K3'); ClearBars(0); end; end |
1449 |
How can I remove all bars from the chart (method 1)
with G2antt1 do begin Columns.Add('Tasks'); Chart.FirstVisibleDate := '1/1/2001'; with Items do begin AddBar(AddItem('Task 1'),'Task','1/2/2001','1/4/2001','K1','K1'); AddBar(AddItem('Task 2'),'Task','1/2/2001','1/4/2001','A2','A2'); AddBar(AddItem('Task 3'),'Task','1/2/2001','1/4/2001','K3','K3'); RemoveBar(0,'<*>'); end; end |
1448 |
Is it possible to update at once a property for several bars without enumerating them
with G2antt1 do begin Columns.Add('Tasks'); Chart.FirstVisibleDate := '1/1/2001'; with Items do begin AddBar(AddItem('Task 1'),'Task','1/2/2001','1/4/2001','K1','K1'); AddBar(AddItem('Task 2'),'Task','1/2/2001','1/4/2001','A2','A2'); AddBar(AddItem('Task 3'),'Task','1/2/2001','1/4/2001','K3','K3'); ItemBar[0,'<K*>',EXG2ANTTLib_TLB.exBarColor] := OleVariant(255); end; end |
1447 |
Is it possible to update at once a property of ALL bars without enumerating them
with G2antt1 do begin Columns.Add('Tasks'); Chart.FirstVisibleDate := '1/1/2001'; with Items do begin AddBar(AddItem('Task 1'),'Task','1/2/2001','1/4/2001','K1','K1'); AddBar(AddItem('Task 2'),'Task','1/2/2001','1/4/2001','A2','A2'); AddBar(AddItem('Task 3'),'Task','1/2/2001','1/4/2001','K3','K3'); ItemBar[0,'<*>',EXG2ANTTLib_TLB.exBarColor] := OleVariant(255); end; end |
1446 |
How do I prevent selecting a new item when selecting a bar
with G2antt1 do begin BeginUpdate(); Columns.Add('Task'); with Chart do begin FirstVisibleDate := '12/29/2000'; PaneWidth[False] := 64; LevelCount := 2; SelectOnClick := False; end; with Items do begin AddBar(AddItem('Task 1'),'Task','1/2/2001','1/4/2001','K1',Null); AddBar(AddItem('Task 2'),'Task','1/4/2001','1/6/2001','K2',Null); AddBar(AddItem('Task 3'),'Task','1/8/2001','1/10/2001','K3',Null); SelectItem[FirstVisibleItem] := True; end; EndUpdate(); end |
1445 |
Is it possible to find out all incoming bars ( recursively )
// MouseMove event - Occurs when the user moves the mouse. procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer); begin with G2antt1 do begin b := Chart.BarFromPoint[-1,-1]; i := ItemFromPoint[-1,-1,c,hit]; OutputDebugString( Items.ItemBar[i,OleVariant(b),EXG2ANTTLib_TLB.exBarIncomingBarsAllDebug] ); end end; with G2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/28/2000'; PaneWidth[False] := 96; NonworkingDays := 0; AllowLinkBars := True; AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarAuto; end; with Items do begin h1 := AddItem('Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','A','A'); h2 := AddItem('Task 2'); AddBar(h2,'Task','1/5/2001','1/7/2001','B','B'); AddLink('L1',h1,'A',h2,'B'); h3 := AddItem('Task 3'); AddBar(h3,'Task','1/8/2001','1/10/2001','C','C'); AddLink('L2',h2,'B',h3,'C'); h4 := AddItem('Task 4'); AddBar(h4,'Task','1/8/2001','1/10/2001','D','D'); AddLink('L3',h1,'A',h4,'D'); end; EndUpdate(); end |
1444 |
How do I find the incoming bars
// MouseMove event - Occurs when the user moves the mouse. procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer); begin with G2antt1 do begin b := Chart.BarFromPoint[-1,-1]; i := ItemFromPoint[-1,-1,c,hit]; OutputDebugString( Items.ItemBar[i,OleVariant(b),EXG2ANTTLib_TLB.exBarIncomingBarsDebug] ); end end; with G2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/28/2000'; PaneWidth[False] := 96; NonworkingDays := 0; AllowLinkBars := True; AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarAuto; end; with Items do begin h1 := AddItem('Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','A','A'); h2 := AddItem('Task 2'); AddBar(h2,'Task','1/5/2001','1/7/2001','B','B'); AddLink('L1',h1,'A',h2,'B'); h3 := AddItem('Task 3'); AddBar(h3,'Task','1/8/2001','1/10/2001','C','C'); AddLink('L2',h2,'B',h3,'C'); h4 := AddItem('Task 4'); AddBar(h4,'Task','1/8/2001','1/10/2001','D','D'); AddLink('L3',h1,'A',h4,'D'); end; EndUpdate(); end |
1443 |
Is it possible to find out all incoming links ( recursively ). Incoming link is a link from another bar to the current bar
// MouseMove event - Occurs when the user moves the mouse. procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer); begin with G2antt1 do begin b := Chart.BarFromPoint[-1,-1]; i := ItemFromPoint[-1,-1,c,hit]; OutputDebugString( Items.ItemBar[i,OleVariant(b),EXG2ANTTLib_TLB.exBarIncomingLinksAllAsString] ); end end; with G2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/28/2000'; PaneWidth[False] := 96; NonworkingDays := 0; AllowLinkBars := True; AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarAuto; end; with Items do begin h1 := AddItem('Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','A','A'); h2 := AddItem('Task 2'); AddBar(h2,'Task','1/5/2001','1/7/2001','B','B'); AddLink('L1',h1,'A',h2,'B'); h3 := AddItem('Task 3'); AddBar(h3,'Task','1/8/2001','1/10/2001','C','C'); AddLink('L2',h2,'B',h3,'C'); h4 := AddItem('Task 4'); AddBar(h4,'Task','1/8/2001','1/10/2001','D','D'); AddLink('L3',h1,'A',h4,'D'); end; EndUpdate(); end |
1442 |
How do I find the incoming links. Incoming link is link from another bar to the current bar
// MouseMove event - Occurs when the user moves the mouse. procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer); begin with G2antt1 do begin b := Chart.BarFromPoint[-1,-1]; i := ItemFromPoint[-1,-1,c,hit]; OutputDebugString( Items.ItemBar[i,OleVariant(b),EXG2ANTTLib_TLB.exBarIncomingLinksAsString] ); end end; with G2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/28/2000'; PaneWidth[False] := 96; NonworkingDays := 0; AllowLinkBars := True; AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarAuto; end; with Items do begin h1 := AddItem('Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','A','A'); h2 := AddItem('Task 2'); AddBar(h2,'Task','1/5/2001','1/7/2001','B','B'); AddLink('L1',h1,'A',h2,'B'); h3 := AddItem('Task 3'); AddBar(h3,'Task','1/8/2001','1/10/2001','C','C'); AddLink('L2',h2,'B',h3,'C'); h4 := AddItem('Task 4'); AddBar(h4,'Task','1/8/2001','1/10/2001','D','D'); AddLink('L3',h1,'A',h4,'D'); end; EndUpdate(); end |
1441 |
Is it possible to find out all outgoing bars ( recursively )
// MouseMove event - Occurs when the user moves the mouse. procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer); begin with G2antt1 do begin b := Chart.BarFromPoint[-1,-1]; i := ItemFromPoint[-1,-1,c,hit]; OutputDebugString( Items.ItemBar[i,OleVariant(b),EXG2ANTTLib_TLB.exBarOutgoingBarsAllDebug] ); end end; with G2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/28/2000'; PaneWidth[False] := 96; NonworkingDays := 0; AllowLinkBars := True; AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarAuto; end; with Items do begin h1 := AddItem('Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','A','A'); h2 := AddItem('Task 2'); AddBar(h2,'Task','1/5/2001','1/7/2001','B','B'); AddLink('L1',h1,'A',h2,'B'); h3 := AddItem('Task 3'); AddBar(h3,'Task','1/8/2001','1/10/2001','C','C'); AddLink('L2',h2,'B',h3,'C'); h4 := AddItem('Task 4'); AddBar(h4,'Task','1/8/2001','1/10/2001','D','D'); AddLink('L3',h1,'A',h4,'D'); end; EndUpdate(); end |
1440 |
How do I find the outgoing bars
// MouseMove event - Occurs when the user moves the mouse. procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer); begin with G2antt1 do begin b := Chart.BarFromPoint[-1,-1]; i := ItemFromPoint[-1,-1,c,hit]; OutputDebugString( Items.ItemBar[i,OleVariant(b),EXG2ANTTLib_TLB.exBarOutgoingBarsDebug] ); end end; with G2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/28/2000'; PaneWidth[False] := 96; NonworkingDays := 0; AllowLinkBars := True; AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarAuto; end; with Items do begin h1 := AddItem('Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','A','A'); h2 := AddItem('Task 2'); AddBar(h2,'Task','1/5/2001','1/7/2001','B','B'); AddLink('L1',h1,'A',h2,'B'); h3 := AddItem('Task 3'); AddBar(h3,'Task','1/8/2001','1/10/2001','C','C'); AddLink('L2',h2,'B',h3,'C'); h4 := AddItem('Task 4'); AddBar(h4,'Task','1/8/2001','1/10/2001','D','D'); AddLink('L3',h1,'A',h4,'D'); end; EndUpdate(); end |
1439 |
Is it possible to find out all outgoing links ( recursively ). Outgoing link is link from a bar to another bar
// MouseMove event - Occurs when the user moves the mouse. procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer); begin with G2antt1 do begin b := Chart.BarFromPoint[-1,-1]; i := ItemFromPoint[-1,-1,c,hit]; OutputDebugString( Items.ItemBar[i,OleVariant(b),EXG2ANTTLib_TLB.exBarOutgoingLinksAllAsString] ); end end; with G2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/28/2000'; PaneWidth[False] := 96; NonworkingDays := 0; AllowLinkBars := True; AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarAuto; end; with Items do begin h1 := AddItem('Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','A','A'); h2 := AddItem('Task 2'); AddBar(h2,'Task','1/5/2001','1/7/2001','B','B'); AddLink('L1',h1,'A',h2,'B'); h3 := AddItem('Task 3'); AddBar(h3,'Task','1/8/2001','1/10/2001','C','C'); AddLink('L2',h2,'B',h3,'C'); h4 := AddItem('Task 4'); AddBar(h4,'Task','1/8/2001','1/10/2001','D','D'); AddLink('L3',h1,'A',h4,'D'); end; EndUpdate(); end |
1438 |
How do I find the outgoing links. Outgoing link is link from a bar to another bar
// MouseMove event - Occurs when the user moves the mouse. procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer); begin with G2antt1 do begin b := Chart.BarFromPoint[-1,-1]; i := ItemFromPoint[-1,-1,c,hit]; OutputDebugString( Items.ItemBar[i,OleVariant(b),EXG2ANTTLib_TLB.exBarOutgoingLinksAsString] ); end end; with G2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin LevelCount := 2; FirstVisibleDate := '12/28/2000'; PaneWidth[False] := 96; NonworkingDays := 0; AllowLinkBars := True; AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarAuto; end; with Items do begin h1 := AddItem('Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','A','A'); h2 := AddItem('Task 2'); AddBar(h2,'Task','1/5/2001','1/7/2001','B','B'); AddLink('L1',h1,'A',h2,'B'); h3 := AddItem('Task 3'); AddBar(h3,'Task','1/8/2001','1/10/2001','C','C'); AddLink('L2',h2,'B',h3,'C'); h4 := AddItem('Task 4'); AddBar(h4,'Task','1/8/2001','1/10/2001','D','D'); AddLink('L3',h1,'A',h4,'D'); end; EndUpdate(); end |
1437 |
How do I select a bar using the right-click
// MouseDown event - Occurs when the user presses a mouse button. procedure TForm1.G2antt1MouseDown(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer); begin with G2antt1 do begin with Items do begin ItemBar[0,'<*>',EXG2ANTTLib_TLB.exBarSelected] := OleVariant(False); ItemBar[G2antt1.ItemFromPoint[-1,-1,c,hit],G2antt1.Chart.BarFromPoint[-1,-1],EXG2ANTTLib_TLB.exBarSelected] := OleVariant(True); end; end end; with G2antt1 do begin BeginUpdate(); Columns.Add('Task'); with Chart do begin FirstVisibleDate := '12/29/2000'; PaneWidth[False] := 64; LevelCount := 2; end; with Items do begin AddBar(AddItem('Task 1'),'Task','1/2/2001','1/4/2001','K1',Null); AddBar(AddItem('Task 2'),'Task','1/4/2001','1/6/2001','K2',Null); AddBar(AddItem('Task 3'),'Task','1/8/2001','1/10/2001','K3',Null); end; EndUpdate(); end |
1436 |
How can I add or change the padding (spaces) for captions in the control's header
with G2antt1 do begin BeginUpdate(); (IUnknown(Columns.Add('Padding-Left')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exHeaderPaddingLeft] := OleVariant(18); with (IUnknown(Columns.Add('Padding-Right')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exHeaderPaddingRight] := OleVariant(18); HeaderAlignment := EXG2ANTTLib_TLB.RightAlignment; end; EndUpdate(); end |
1435 |
Do you have any plans to add cell spacing and cell padding to the cells
with G2antt1 do begin BeginUpdate(); DrawGridLines := EXG2ANTTLib_TLB.exRowLines; with (IUnknown(Columns.Add('Padding-Left')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellHasCheckBox] := OleVariant(True); Def[EXG2ANTTLib_TLB.exCellPaddingLeft] := OleVariant(18); end; (IUnknown(Columns.Add('No-Padding')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellHasCheckBox] := OleVariant(True); (IUnknown(Columns.Add('Empty')) as EXG2ANTTLib_TLB.Column).Position := 0; with Items do begin CellValue[OleVariant(AddItem('Item A.1')),OleVariant(1)] := 'Item A.2'; CellValue[OleVariant(AddItem('Item B.1')),OleVariant(1)] := 'Item B.2'; CellValue[OleVariant(AddItem('Item C.1')),OleVariant(1)] := 'Item C.2'; end; EndUpdate(); end |
1434 |
Can I display somehow the filter just on the top of the list, with an editor associated to each column
// AddItem event - Occurs after a new Item has been inserted to Items collection. procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM); begin with G2antt1 do begin with Items do begin AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null); end; end end; // Change event - Occurs when the user changes the cell's content. procedure TForm1.G2antt1Change(ASender: TObject; Item : HITEM;ColIndex : Integer;var NewValue : OleVariant); begin with G2antt1 do begin OutputDebugString( 'Locked:' ); OutputDebugString( Items.IsItemLocked[Item] ); with Columns.Item[OleVariant(ColIndex)] do begin Filter := NewValue; FilterType := EXG2ANTTLib_TLB.exPattern; end; ApplyFilter(); end end; // MouseUp event - Occurs when the user releases a mouse button. procedure TForm1.G2antt1MouseUp(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer); begin with G2antt1 do begin Edit(Items.LockedItem[EXG2ANTTLib_TLB.exTop,0]); end end; with G2antt1 do begin ColumnAutoResize := False; ScrollBySingleLine := True; ContinueColumnScroll := False; Chart.FirstVisibleDate := '8/3/1994'; rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset); with rs do begin Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null); end; DataSource := (IUnknown(rs) as ADODB_TLB.Recordset); with Items do begin LockedItemCount[EXG2ANTTLib_TLB.exTop] := 2; h := LockedItem[EXG2ANTTLib_TLB.exTop,0]; CellEditor[OleVariant(h),OleVariant(0)].EditType := EXG2ANTTLib_TLB.EditType; h := LockedItem[EXG2ANTTLib_TLB.exTop,1]; ItemHeight[h] := 4; ItemDivider[h] := 0; SelectableItem[h] := False; end; end |
1433 |
Is it possible to display information about the firing events
|
1432 |
I need to specify the start and end dates of the bar to be the same, but to keep count of the working units. Is it possible
with G2antt1 do begin BeginUpdate(); MarkSearchColumn := False; with Columns do begin Add('Tasks'); (IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1); (IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(543); end; with Chart do begin FirstVisibleDate := '9/20/2006'; LevelCount := 2; PaneWidth[False] := 256; ShowEmptyBars := 1; Bars.Add('Task:Split').Shortcut := 'Task'; end; with Items do begin AllowCellValueToItemBar := True; AddBar(AddItem('Task 1'),'Task','9/21/2006','9/21/2006',Null,Null); AddBar(AddItem('Task 2'),'Task','9/22/2006','9/25/2006',Null,Null); AddBar(AddItem('Task 3'),'Task','9/25/2006','9/25/2006',Null,Null); ItemBar[0,'<*>',EXG2ANTTLib_TLB.exBarKeepWorkingCount] := OleVariant(True); end; EndUpdate(); end |
1431 |
I need to specify the start and end dates of the bar to be the same, but no bars are shown. (NOT recommended for bars with exBarKeepWorkingCount ) What I can do
with G2antt1 do begin BeginUpdate(); MarkSearchColumn := False; with Columns do begin Add('Tasks'); (IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1); (IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(543); end; with Chart do begin FirstVisibleDate := '9/20/2006'; LevelCount := 2; PaneWidth[False] := 256; ShowEmptyBars := 1; end; with Items do begin AllowCellValueToItemBar := True; AddBar(AddItem('Task 1'),'Task','9/21/2006','9/21/2006',Null,Null); AddBar(AddItem('Task 2'),'Task','9/22/2006','9/22/2006',Null,Null); AddBar(AddItem('Task 3'),'Task','9/25/2006','9/25/2006',Null,Null); end; EndUpdate(); end |
1430 |
I need my chart to display the end date with on day less. How can I do this (Method 2)
with G2antt1 do begin BeginUpdate(); MarkSearchColumn := False; with Columns do begin Add('Tasks'); with (IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1); Editor.EditType := EXG2ANTTLib_TLB.DateType; end; with (IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(543); Editor.EditType := EXG2ANTTLib_TLB.DateType; end; end; with Chart do begin FirstVisibleDate := '9/20/2006'; LevelCount := 2; PaneWidth[False] := 256; NonworkingDays := 0; end; with Items do begin AllowCellValueToItemBar := True; AddBar(AddItem('Task 1'),'Task','9/21/2006','9/24/2006',Null,Null); AddBar(AddItem('Task 2'),'Task','9/22/2006','9/25/2006',Null,Null); AddBar(AddItem('Task 3'),'Task','9/23/2006','9/26/2006',Null,Null); end; EndUpdate(); end |
1429 |
Is it possible to change the width of a specified time unit
with G2antt1 do begin BeginUpdate(); with Chart do begin PaneWidth[False] := 0; LevelCount := 2; FirstVisibleDate := '1/1/2008'; AllowInsideZoom := True; AllowResizeInsideZoom := False; InsideZoomOnDblClick := False; DefaultInsideZoomFormat.BackColorChart := $ff00ff; with InsideZooms do begin SplitBaseLevel := False; DefaultWidth := 18; with Add('1/15/2008') do begin AllowInsideFormat := False; Width := 128; end; end; end; EndUpdate(); end |
1428 |
The level unit of the chart is set to day, so i'd like to set the whole background of the current day. Is it possible to set a background color only on the current day (Method 2)
with G2antt1 do begin BeginUpdate(); with Chart do begin PaneWidth[False] := 0; LevelCount := 2; FirstVisibleDate := '1/1/2008'; AllowInsideZoom := True; AllowResizeInsideZoom := False; InsideZoomOnDblClick := False; DefaultInsideZoomFormat.BackColorChart := $ff; with InsideZooms do begin SplitBaseLevel := False; DefaultWidth := 18; Add('1/15/2008').AllowInsideFormat := False; end; end; EndUpdate(); end |
1427 |
The level unit of the chart is set to day, so i'd like to set the whole background of the current day. Is it possible to set a background color only on the current day (Method 1)
with G2antt1 do begin BeginUpdate(); with Chart do begin PaneWidth[False] := 0; FirstVisibleDate := '1/1/2008'; MarkTodayColor := BackColor; LevelCount := 2; MarkSelectDateColor := $7fff0000; SelectLevel := 1; SelectDate['1/15/2008'] := True; end; EndUpdate(); end |
1426 |
How can I change the layout of my columns when using the exCRD
with G2antt1 do begin BeginUpdate(); DrawGridLines := EXG2ANTTLib_TLB.exRowLines; DefaultItemHeight := 36; with Columns do begin with (IUnknown(Add('Column1')) as EXG2ANTTLib_TLB.Column) do begin Visible := False; Editor.EditType := EXG2ANTTLib_TLB.EditType; end; with (IUnknown(Add('Column2')) as EXG2ANTTLib_TLB.Column) do begin Visible := False; Editor.EditType := EXG2ANTTLib_TLB.EditType; end; (IUnknown(Add('Column3')) as EXG2ANTTLib_TLB.Column).Visible := False; with (IUnknown(Add('FormatLevel')) as EXG2ANTTLib_TLB.Column) do begin FormatLevel := '(0/1),2'; Def[EXG2ANTTLib_TLB.exCellFormatLevel] := OleVariant(FormatLevel); end; end; with Items do begin h := AddItem('Cell 1.1'); CellValue[OleVariant(h),OleVariant(1)] := 'Cell 1.2'; CellValue[OleVariant(h),OleVariant(2)] := 'Cell 1.3'; h := AddItem('Cell 2.1'); CellValue[OleVariant(h),OleVariant(1)] := 'Cell 2.2'; CellValue[OleVariant(h),OleVariant(2)] := 'Cell 2.3'; end; EndUpdate(); end |
1425 |
How can I overlaid a single bar
with G2antt1 do begin BeginUpdate(); DefaultItemHeight := 22; Columns.Add('Task'); ScrollBySingleLine := True; BackColorAlternate := RGB(240,240,240); with Chart do begin AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarAuto; PaneWidth[False] := 48; FirstVisibleDate := '12/28/2000'; LevelCount := 2; with Bars.Item['Task'] do begin OverlaidGroup := 'OTask'; OverlaidType := EXG2ANTTLib_TLB.exOverlaidBarsNone; Def[EXG2ANTTLib_TLB.exBarCaption] := '<%=%9%>'; end; with Bars.Copy('Task','OTask') do begin OverlaidGroup := 'Task'; OverlaidType := Integer(EXG2ANTTLib_TLB.exOverlaidBarsStrict) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsCascade); end; end; with Items do begin h1 := AddItem('Default'); h := AddItem('Overlaid'); AddBar(h,'Task','1/2/2001','1/4/2001','A1',Null); AddBar(h,'Task','1/4/2001','1/7/2001','A3',Null); AddBar(h,'OTask','1/3/2001','1/5/2001','A2',Null); ItemBar[h,'A2',EXG2ANTTLib_TLB.exBarColor] := OleVariant(255); AddBar(h,'Task','1/5/2001','1/8/2001','A4',Null); h1 := AddItem('Default'); end; EndUpdate(); end |
1424 |
How can I use the exOverlaidBarsCascade, exBarOverlaidKey
// CreateBar event - Fired when the user creates a new bar. procedure TForm1.G2antt1CreateBar(ASender: TObject; Item : HITEM;DateStart : TDateTime;DateEnd : TDateTime); begin with G2antt1 do begin Items.ItemBar[Item,'newbar',EXG2ANTTLib_TLB.exBarOverlaidKey] := 'Level0'; end end; with G2antt1 do begin BeginUpdate(); DefaultItemHeight := 22; Columns.Add('Task'); ScrollBySingleLine := True; BackColorAlternate := RGB(240,240,240); with Chart do begin AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarAuto; PaneWidth[False] := 48; FirstVisibleDate := '12/28/2000'; LevelCount := 2; with Bars.Item['Task'] do begin OverlaidType := EXG2ANTTLib_TLB.exOverlaidBarsCascade; Def[EXG2ANTTLib_TLB.exBarCaption] := '<%=%9%>'; end; end; with Items do begin h1 := AddItem('Default'); h := AddItem('Overlaid'); AddBar(h,'Task','1/2/2001','1/4/2001','A1',Null); ItemBar[h,'A1',EXG2ANTTLib_TLB.exBarOverlaidKey] := 'Level0'; AddBar(h,'Task','1/4/2001','1/7/2001','A3',Null); ItemBar[h,'A3',EXG2ANTTLib_TLB.exBarOverlaidKey] := 'Level0'; AddBar(h,'Task','1/3/2001','1/5/2001','A2',Null); ItemBar[h,'A2',EXG2ANTTLib_TLB.exBarColor] := OleVariant(255); ItemBar[h,'A2',EXG2ANTTLib_TLB.exBarOverlaidKey] := 'Level1'; AddBar(h,'Task','1/5/2001','1/8/2001','A4',Null); ItemBar[h,'A4',EXG2ANTTLib_TLB.exBarColor] := OleVariant(255); ItemBar[h,'A4',EXG2ANTTLib_TLB.exBarOverlaidKey] := 'Level1'; h1 := AddItem('Default'); end; EndUpdate(); end |
1423 |
How can I use the exOverlaidBarsStack+exOverlaidBarsStackAutoArrange
with G2antt1 do begin BeginUpdate(); DefaultItemHeight := 22; Columns.Add('Task'); ScrollBySingleLine := True; BackColorAlternate := RGB(240,240,240); with Chart do begin PaneWidth[False] := 48; FirstVisibleDate := '12/28/2000'; LevelCount := 2; with Bars.Item['Task'] do begin OverlaidType := Integer(EXG2ANTTLib_TLB.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsStack); Def[EXG2ANTTLib_TLB.exBarCaption] := '<%=%9%>'; end; end; with Items do begin h1 := AddItem('Default'); h := AddItem('Overlaid'); AddBar(h,'Task','1/2/2001','1/4/2001','A1',Null); AddBar(h,'Task','1/3/2001','1/5/2001','A2',Null); AddBar(h,'Task','1/4/2001','1/7/2001','A3',Null); AddBar(h,'Task','1/5/2001','1/8/2001','A4',Null); h1 := AddItem('Default'); end; EndUpdate(); end |
1422 |
How can I use the exOverlaidBarsStack
with G2antt1 do begin BeginUpdate(); DefaultItemHeight := 22; Columns.Add('Task'); ScrollBySingleLine := True; BackColorAlternate := RGB(240,240,240); with Chart do begin PaneWidth[False] := 48; FirstVisibleDate := '12/28/2000'; LevelCount := 2; with Bars.Item['Task'] do begin OverlaidType := EXG2ANTTLib_TLB.exOverlaidBarsStack; Def[EXG2ANTTLib_TLB.exBarCaption] := '<%=%9%>'; end; end; with Items do begin h1 := AddItem('Default'); h := AddItem('Overlaid'); AddBar(h,'Task','1/2/2001','1/4/2001','A1',Null); AddBar(h,'Task','1/3/2001','1/5/2001','A2',Null); AddBar(h,'Task','1/4/2001','1/7/2001','A3',Null); AddBar(h,'Task','1/5/2001','1/8/2001','A4',Null); h1 := AddItem('Default'); end; EndUpdate(); end |
1421 |
How can I use the exOverlaidBarsIntersect
with G2antt1 do begin BeginUpdate(); DefaultItemHeight := 22; Columns.Add('Task'); ScrollBySingleLine := True; BackColorAlternate := RGB(240,240,240); with Chart do begin PaneWidth[False] := 48; FirstVisibleDate := '12/28/2000'; LevelCount := 2; with Bars.Item['Task'] do begin OverlaidType := EXG2ANTTLib_TLB.exOverlaidBarsIntersect; Overlaid[EXG2ANTTLib_TLB.exOverlaidBarsIntersect] := 'Progress'; Def[EXG2ANTTLib_TLB.exBarCaption] := '<%=%9%>'; end; end; with Items do begin h1 := AddItem('Default'); h := AddItem('Overlaid'); AddBar(h,'Task','1/2/2001','1/4/2001','A1',Null); AddBar(h,'Task','1/3/2001','1/5/2001','A2',Null); AddBar(h,'Task','1/4/2001','1/7/2001','A3',Null); AddBar(h,'Task','1/5/2001','1/8/2001','A4',Null); h1 := AddItem('Default'); end; EndUpdate(); end |
1420 |
How can I use the exOverlaidBarsOffset
with G2antt1 do begin BeginUpdate(); DefaultItemHeight := 22; Columns.Add('Task'); ScrollBySingleLine := True; BackColorAlternate := RGB(240,240,240); with Chart do begin PaneWidth[False] := 48; FirstVisibleDate := '12/28/2000'; LevelCount := 2; with Bars.Item['Task'] do begin OverlaidType := EXG2ANTTLib_TLB.exOverlaidBarsOffset; Def[EXG2ANTTLib_TLB.exBarCaption] := '<%=%9%>'; end; end; with Items do begin h1 := AddItem('Default'); h := AddItem('Overlaid'); AddBar(h,'Task','1/2/2001','1/4/2001','A1',Null); AddBar(h,'Task','1/3/2001','1/5/2001','A2',Null); AddBar(h,'Task','1/4/2001','1/7/2001','A3',Null); AddBar(h,'Task','1/5/2001','1/8/2001','A4',Null); h1 := AddItem('Default'); end; EndUpdate(); end |
1419 |
Is it possible to specify the end of the project when using the SchedulePDM method
with G2antt1 do begin BeginUpdate(); Columns.Add('Task'); with Chart do begin FirstVisibleDate := '12/28/2000'; PaneWidth[False] := 48; LevelCount := 2; end; with Items do begin h1 := AddItem('Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null); h2 := AddItem('Task 2'); AddBar(h2,'Task','1/2/2001','1/5/2001','K2',Null); AddLink('L1',h1,'K1',h2,'K2'); Link['L1',EXG2ANTTLib_TLB.exLinkText] := 'FS'; h3 := AddItem('Task 3'); AddBar(h3,'Task','1/2/2001','1/6/2001','K3',Null); AddLink('L2',h2,'K2',h3,'K3'); Link['L2',EXG2ANTTLib_TLB.exLinkText] := 'SS'; Link['L2',EXG2ANTTLib_TLB.exLinkStartPos] := OleVariant(0); Link['L2',EXG2ANTTLib_TLB.exLinkEndPos] := OleVariant(0); DefSchedulePDM[EXG2ANTTLib_TLB.exPDMScheduleType] := OleVariant(2); DefSchedulePDM[EXG2ANTTLib_TLB.exPDMScheduleDate] := '1/8/2001'; SchedulePDM(0,'K1'); end; EndUpdate(); end |
1418 |
Is it possible to specify the start of the project when using the SchedulePDM method
with G2antt1 do begin BeginUpdate(); Columns.Add('Task'); with Chart do begin FirstVisibleDate := '12/28/2000'; PaneWidth[False] := 48; LevelCount := 2; end; with Items do begin h1 := AddItem('Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null); h2 := AddItem('Task 2'); AddBar(h2,'Task','1/2/2001','1/5/2001','K2',Null); AddLink('L1',h1,'K1',h2,'K2'); Link['L1',EXG2ANTTLib_TLB.exLinkText] := 'FS'; h3 := AddItem('Task 3'); AddBar(h3,'Task','1/2/2001','1/6/2001','K3',Null); AddLink('L2',h2,'K2',h3,'K3'); Link['L2',EXG2ANTTLib_TLB.exLinkText] := 'SS'; Link['L2',EXG2ANTTLib_TLB.exLinkStartPos] := OleVariant(0); Link['L2',EXG2ANTTLib_TLB.exLinkEndPos] := OleVariant(0); DefSchedulePDM[EXG2ANTTLib_TLB.exPDMScheduleType] := OleVariant(1); DefSchedulePDM[EXG2ANTTLib_TLB.exPDMScheduleDate] := '1/8/2001'; SchedulePDM(0,'K1'); end; EndUpdate(); end |
1417 |
How can I change the caption or the addition information being displayed in the Zoom-OnFly view
with G2antt1 do begin BeginUpdate(); Columns.Add('Task'); with Chart do begin PaneWidth[False] := 48; FirstVisibleDate := '1/1/2001'; LevelCount := 2; AllowZoomOnFly := EXG2ANTTLib_TLB.exZoomOnFly; ResizeUnitScale := EXG2ANTTLib_TLB.exHour; Label[EXG2ANTTLib_TLB.exHour] := '<font ;5><b><%h%><br><%AM/PM%></b></font>'; ZoomOnFlyCaption := '<br><c><b><font ;12><%=%C0 + '' / <fgcolor=00FF00>'' + %3%></font></fgcolor></b><br><solidline><upline><b>Start</b>:<%=%1%><br><b>' + 'End</b>:<%=%2%><br><b>Duration</b>:<%=round(%2-%1) + '' days''%><br><b>Working</b>:<%=''<b>'' + int(%258) + ''</b> days'' + (0:=(%258 ' + '- int(%258)) ? ('' <fgcolor=FF0000><b>'' + round(24 * =:0) + ''</b> hours'') : '''') %>'; end; with Items do begin h := AddItem('Task 1'); AddBar(h,'Task','1/7/2001','1/10/2001','T1','T1'); AddBar(h,'Task','1/11/2001','1/14/2001','T3','T3'); h := AddItem(Null); AddBar(h,'','1/15/2001','1/15/2001','','Focus the chart ( click here ), and press the <b>CTRL + SHIFT</b>, so the Zoom-OnFly is shown.'); SelectableItem[h] := False; end; EndUpdate(); end |
1416 |
How can I change the scale in the Zoom-OnFly view
with G2antt1 do begin BeginUpdate(); Columns.Add('Task'); with Chart do begin PaneWidth[False] := 48; FirstVisibleDate := '1/1/2001'; LevelCount := 2; AllowZoomOnFly := EXG2ANTTLib_TLB.exZoomOnFly; ResizeUnitScale := EXG2ANTTLib_TLB.exHour; Label[EXG2ANTTLib_TLB.exHour] := '<font ;5><b><%h%><br><%AM/PM%></b></font>'; ZoomOnFlyCaption := ''; end; with Items do begin h := AddItem('Task 1'); AddBar(h,'Task','1/7/2001','1/10/2001','T1','T1'); AddBar(h,'Task','1/11/2001','1/14/2001','T3','T3'); h := AddItem(Null); AddBar(h,'','1/15/2001','1/15/2001','','Focus the chart ( click here ), and press the <b>CTRL + SHIFT</b>, so the Zoom-OnFly is shown.'); SelectableItem[h] := False; end; EndUpdate(); end |
1415 |
Is it possible to change the Zoom-OnFly view's background color
with G2antt1 do begin BeginUpdate(); Columns.Add('Task'); with Chart do begin PaneWidth[False] := 48; FirstVisibleDate := '1/1/2001'; LevelCount := 2; AllowZoomOnFly := EXG2ANTTLib_TLB.exZoomOnFly; BackColorZoomOnFly := $f0f0f0; end; with Items do begin h := AddItem('Task 1'); AddBar(h,'Task','1/7/2001','1/10/2001','T1','T1'); AddBar(h,'Task','1/11/2001','1/14/2001','T3','T3'); h := AddItem(Null); AddBar(h,'','1/15/2001','1/15/2001','','Focus the chart ( click here ), and press the <b>CTRL + SHIFT</b>, so the Zoom-OnFly is shown.'); SelectableItem[h] := False; end; EndUpdate(); end |
1414 |
How can I include the selected items in the Zoom-OnFly view
with G2antt1 do begin BeginUpdate(); Columns.Add('Task'); with Chart do begin PaneWidth[False] := 48; FirstVisibleDate := '1/1/2001'; LevelCount := 2; AllowZoomOnFly := Integer(EXG2ANTTLib_TLB.exZoomOnFlyIncludeSelectedItems) Or Integer(EXG2ANTTLib_TLB.exZoomOnFly); SelBackColor := $f0f0f0; SelectOnClick := False; end; with Items do begin h := AddItem('Task 1'); AddBar(h,'Task','1/7/2001','1/10/2001','T1','T1'); SelectItem[h] := True; h := AddItem('Task 2'); AddBar(h,'Task','1/11/2001','1/14/2001','T2','T2'); h := AddItem('Task 3'); AddBar(h,'Task','1/8/2001','1/12/2001','T3','T3'); h := AddItem(Null); AddBar(h,'','1/15/2001','1/15/2001','','Focus the chart ( click here ), and press the <b>CTRL + SHIFT</b>, so the Zoom-OnFly is shown.'); SelectableItem[h] := False; end; EndUpdate(); end |
1413 |
Is it possible to include the neighbors items in the Zoom-OnFly view
with G2antt1 do begin BeginUpdate(); Columns.Add('Task'); with Chart do begin PaneWidth[False] := 48; FirstVisibleDate := '1/1/2001'; LevelCount := 2; AllowZoomOnFly := Integer(EXG2ANTTLib_TLB.exZoomOnFlyIncludeNeighborItems) Or Integer(EXG2ANTTLib_TLB.exZoomOnFly); end; with Items do begin h := AddItem('Task 1'); AddBar(h,'Task','1/7/2001','1/10/2001','T1','T1'); h := AddItem('Task 2'); AddBar(h,'Task','1/11/2001','1/14/2001','T3','T3'); h := AddItem('Task 3'); AddBar(h,'Task','1/8/2001','1/12/2001','T1','T1'); h := AddItem(Null); AddBar(h,'','1/15/2001','1/15/2001','','Focus the chart ( click here ), and press the <b>CTRL + SHIFT</b>, so the Zoom-OnFly is shown.'); SelectableItem[h] := False; end; EndUpdate(); end |
1412 |
How can I enable the Zoom-OnFly view
with G2antt1 do begin BeginUpdate(); Columns.Add('Task'); with Chart do begin PaneWidth[False] := 48; FirstVisibleDate := '11/5/2000'; LevelCount := 2; UnitScale := EXG2ANTTLib_TLB.exWeek; ResizeUnitScale := EXG2ANTTLib_TLB.exDay; AllowZoomOnFly := EXG2ANTTLib_TLB.exZoomOnFly; Bars.Item['Task'].OverlaidType := EXG2ANTTLib_TLB.exOverlaidBarsStack; end; with Items do begin h := AddItem('Task 1'); AddBar(h,'Task','1/7/2001','1/17/2001','T1','T1'); AddBar(h,'Task','1/18/2001','2/24/2001','T3','T3'); h := AddItem(Null); AddBar(h,'','1/15/2001','1/15/2001','','Focus the chart ( click here ), and press the <b>CTRL + SHIFT</b>, so the Zoom-OnFly is shown.'); SelectableItem[h] := False; end; EndUpdate(); end |
1411 |
I am using the overlay bars on stack, can I somehow tell a type of bar, or a specific bar, to be always on top of all other’s. Like a Z-Index or something
with G2antt1 do begin BeginUpdate(); ScrollBySingleLine := True; Columns.Add('Task'); DrawGridLines := EXG2ANTTLib_TLB.exHLines; with Chart do begin DrawGridLines := EXG2ANTTLib_TLB.exHLines; AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarAuto; AllowLinkBars := False; ResizeUnitScale := EXG2ANTTLib_TLB.exHour; PaneWidth[False] := 48; FirstVisibleDate := '1/1/2001'; Bars.Item['Task'].OverlaidType := EXG2ANTTLib_TLB.exOverlaidBarsStack; end; with Items do begin h := AddItem('Task 1'); AddBar(h,'Task','1/7/2001','1/10/2001','A1','A1'); AddBar(h,'Task','1/8/2001','1/12/2001','A3','A3'); ItemBar[h,'A3',EXG2ANTTLib_TLB.exBarColor] := OleVariant(65280); h := AddItem('Task 2'); AddBar(h,'Task','1/7/2001','1/10/2001','A31','A31'); AddBar(h,'Task','1/8/2001','1/12/2001','A3','A3'); ItemBar[h,'A3',EXG2ANTTLib_TLB.exBarColor] := OleVariant(255); AddBar(AddItem(Null),'','1/10/2001','1/10/2001',Null,'The <b>Key</b> of the bar specifies the Z-Order when overlaying.'); end; EndUpdate(); end |
1410 |
Is it possible to specify the z-order when using the overlaying feature
with G2antt1 do begin BeginUpdate(); Columns.Add('Tasks'); with Chart do begin NonworkingDays := 0; FirstVisibleDate := '9/17/2006'; PaneWidth[False] := 64; LevelCount := 2; Bars.Item['Task'].OverlaidType := EXG2ANTTLib_TLB.exOverlaidBarsCascade; end; with Items do begin h1 := AddItem('Task'); AddBar(h1,'Task','9/21/2006','9/27/2006','K1','K1'); AddBar(h1,'Task','9/23/2006','9/24/2006','K2','K2'); AddBar(h1,'Task','9/22/2006','9/25/2006','K3','K3'); AddBar(h1,'Task','9/21/2006','9/27/2006','T1','T1'); AddBar(h1,'Task','9/28/2006','9/29/2006','T2','T2'); AddBar(h1,'Task','9/30/2006','10/3/2006','T3','T3'); ItemBar[0,'<T*>',EXG2ANTTLib_TLB.exBarColor] := OleVariant(65280); ItemBar[0,'<K*>',EXG2ANTTLib_TLB.exBarOverlaidKey] := 'A'; ItemBar[0,'<T*>',EXG2ANTTLib_TLB.exBarOverlaidKey] := 'B'; end; EndUpdate(); end |
1409 |
I seen that there is no exBarStartColor, exBarEndColor, similar to exBarColor, is there any solution so I can display a different Start/End Color
with G2antt1 do begin BeginUpdate(); with Chart do begin FirstVisibleDate := '1/1/2001'; with Bars.Copy('Summary','Aka1') do begin StartColor := $ff; EndColor := $ff0000; end; with Bars.Copy('Summary','Aka2') do begin StartColor := $ff00; EndColor := $ff00ff; end; end; Columns.Add('Column'); with Items do begin h := AddItem('Item A'); AddBar(h,'Task','1/2/2001','1/6/2001','B1',Null); ItemBar[h,'B1',EXG2ANTTLib_TLB.exBarName] := 'Aka1'; h := AddItem('Item B'); AddBar(h,'Task','1/2/2001','1/6/2001','B2',Null); ItemBar[h,'B2',EXG2ANTTLib_TLB.exBarName] := 'Aka2'; end; EndUpdate(); end |
1408 |
How can copy and paste the selection to Microsoft Word, any OLE compliant application, as a snapshot
with G2antt1 do begin BeginUpdate(); VisualAppearance.Add(1,'c:\exontrol\images\normal.ebn'); HTMLPicture['p1'] := 'c:\exontrol\images\card.png'; HTMLPicture['p2'] := 'c:\exontrol\images\sun.png'; AutoDrag := EXG2ANTTLib_TLB.exAutoDragCopySnapShot; LinesAtRoot := EXG2ANTTLib_TLB.exNoLinesAtRoot; HasLines := EXG2ANTTLib_TLB.exThinLine; ShowFocusRect := False; DefaultItemHeight := 26; Columns.Add('Task'); with Chart do begin ShowNonworkingDates := False; FirstVisibleDate := '12/29/2000'; PaneWidth[False] := 96; LevelCount := 2; with Bars.Item['Task'] do begin Color := $1000000; Height := 18; end; end; with Items do begin h := AddItem('<img>p1:32</img>Group 1'); CellValueFormat[OleVariant(h),OleVariant(0)] := EXG2ANTTLib_TLB.exHTML; ItemDivider[h] := 0; ItemBold[h] := True; h1 := InsertItem(h,Null,'Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null); h2 := InsertItem(h,Null,'Task 2'); AddBar(h2,'Task','1/5/2001','1/7/2001','K2',Null); AddLink('L1',h1,'K1',h2,'K2'); Link['L1',EXG2ANTTLib_TLB.exLinkText] := 'L1'; h3 := InsertItem(h,Null,'Task 3'); AddBar(h3,'Task','1/8/2001','1/10/2001','K3',Null); AddLink('L2',h2,'K2',h3,'K3'); Link['L2',EXG2ANTTLib_TLB.exLinkText] := 'L2'; h := AddItem('<img>p2:32</img>Group 2'); CellValueFormat[OleVariant(h),OleVariant(0)] := EXG2ANTTLib_TLB.exHTML; ItemBold[h] := True; ItemDivider[h] := 0; h1 := InsertItem(h,Null,'Task'); AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null); ExpandItem[0] := True; end; EndUpdate(); end |
1407 |
How can copy and paste the selection to Microsoft Word, any OLE compliant application, as a image
with G2antt1 do begin BeginUpdate(); HTMLPicture['p1'] := 'c:\exontrol\images\card.png'; HTMLPicture['p2'] := 'c:\exontrol\images\sun.png'; Chart.PaneWidth[True] := 0; var_HTMLPicture := HTMLPicture['aka1']; HeaderHeight := 24; DefaultItemHeight := 48; DrawGridLines := EXG2ANTTLib_TLB.exRowLines; GridLineColor := RGB(240,240,240); SelBackMode := EXG2ANTTLib_TLB.exTransparent; ColumnAutoResize := False; ContinueColumnScroll := False; rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset); with rs do begin Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null); end; DataSource := (IUnknown(rs) as ADODB_TLB.Recordset); Columns.Item[OleVariant(0)].Def[EXG2ANTTLib_TLB.exCellValueFormat] := OleVariant(1); Columns.Item[OleVariant(0)].FormatColumn := 'value + ` <img>p` + (1 + (value mod 3 ) ) + `</img>`'; Columns.Item[OleVariant(0)].Width := 112; Columns.Item[OleVariant(1)].Def[EXG2ANTTLib_TLB.exCellHasCheckBox] := OleVariant(1); Columns.Item[OleVariant(2)].LevelKey := '1'; Columns.Item[OleVariant(3)].LevelKey := '1'; Columns.Item[OleVariant(4)].LevelKey := '1'; AutoDrag := EXG2ANTTLib_TLB.exAutoDragCopyImage; SingleSel := False; with Items do begin h := ItemByIndex[1]; SelectItem[h] := True; h := ItemByIndex[2]; SelectItem[h] := True; h := ItemByIndex[3]; SelectItem[h] := True; LockedItemCount[EXG2ANTTLib_TLB.exBottom] := 1; h := LockedItem[EXG2ANTTLib_TLB.exBottom,0]; CellValue[OleVariant(h),OleVariant(1)] := '<font ;16>Click the selection and <b>wait to start dragging</b>, and then drop to Microsoft Word, ...'; CellSingleLine[OleVariant(h),OleVariant(1)] := EXG2ANTTLib_TLB.exCaptionWordWrap; CellValueFormat[OleVariant(h),OleVariant(1)] := EXG2ANTTLib_TLB.exHTML; CellHAlignment[OleVariant(h),OleVariant(1)] := EXG2ANTTLib_TLB.CenterAlignment; ItemDivider[h] := 1; ItemDividerLineAlignment[h] := EXG2ANTTLib_TLB.DividerTop; end; EndUpdate(); end |
1406 |
How can copy and paste the selection to Microsoft Word, Excel or any OLE compliant application, as a text
with G2antt1 do begin BeginUpdate(); Chart.PaneWidth[True] := 0; ColumnAutoResize := False; ContinueColumnScroll := False; rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset); with rs do begin Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null); end; DataSource := (IUnknown(rs) as ADODB_TLB.Recordset); Columns.Item[OleVariant(2)].LevelKey := '1'; Columns.Item[OleVariant(3)].LevelKey := '1'; Columns.Item[OleVariant(4)].LevelKey := '1'; AutoDrag := EXG2ANTTLib_TLB.exAutoDragCopyText; SingleSel := False; with Items do begin h := ItemByIndex[1]; SelectItem[h] := True; h := ItemByIndex[3]; SelectItem[h] := True; h := ItemByIndex[4]; SelectItem[h] := True; h := ItemByIndex[5]; SelectItem[h] := True; LockedItemCount[EXG2ANTTLib_TLB.exBottom] := 1; h := LockedItem[EXG2ANTTLib_TLB.exBottom,0]; CellValue[OleVariant(h),OleVariant(0)] := '<font ;16>Click the selection and <b>wait to start dragging</b>, and then drop to Microsoft Word, Excel, ...'; CellSingleLine[OleVariant(h),OleVariant(0)] := EXG2ANTTLib_TLB.exCaptionWordWrap; CellValueFormat[OleVariant(h),OleVariant(0)] := EXG2ANTTLib_TLB.exHTML; CellHAlignment[OleVariant(h),OleVariant(0)] := EXG2ANTTLib_TLB.CenterAlignment; ItemDivider[h] := 0; ItemDividerLineAlignment[h] := EXG2ANTTLib_TLB.DividerTop; end; EndUpdate(); end |
1405 |
Is it possible to change the indentation during the drag and drop
with G2antt1 do begin BeginUpdate(); VisualAppearance.Add(1,'c:\exontrol\images\normal.ebn'); AutoDrag := EXG2ANTTLib_TLB.exAutoDragPositionAny; LinesAtRoot := EXG2ANTTLib_TLB.exNoLinesAtRoot; HasLines := EXG2ANTTLib_TLB.exSolidLine; HasButtons := EXG2ANTTLib_TLB.exWPlus; ShowFocusRect := False; SelBackMode := EXG2ANTTLib_TLB.exTransparent; Columns.Add('Task'); with Chart do begin ShowNonworkingDates := False; FirstVisibleDate := '12/29/2000'; PaneWidth[False] := 128; LevelCount := 2; Bars.Item['Task'].Color := $1000000; end; with Items do begin h := AddItem('Group 1'); ItemBold[h] := True; ItemDivider[h] := 0; h1 := InsertItem(h,Null,'Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null); h2 := InsertItem(h1,Null,'Task 2'); AddBar(h2,'Task','1/15/2001','1/17/2001','K4',Null); h2 := InsertItem(h1,Null,'Task 3'); AddBar(h2,'Task','1/5/2001','1/7/2001','K2',Null); AddLink('L1',h1,'K1',h2,'K2'); Link['L1',EXG2ANTTLib_TLB.exLinkText] := 'L1'; h3 := InsertItem(h,Null,'Task 3'); AddBar(h3,'Task','1/8/2001','1/10/2001','K3',Null); AddLink('L2',h2,'K2',h3,'K3'); Link['L2',EXG2ANTTLib_TLB.exLinkText] := 'L2'; ExpandItem[h] := True; ExpandItem[h1] := True; h := AddItem('Group 2'); ItemBold[h] := True; ItemDivider[h] := 0; LockedItemCount[EXG2ANTTLib_TLB.exBottom] := 1; h := LockedItem[EXG2ANTTLib_TLB.exBottom,0]; CellValue[OleVariant(h),OleVariant(0)] := 'Click a row, and move by dragging <b>up, down</b> to change the row''s parent or <b>left,right</b> to increase or decrease the in' + 'dentation.'; CellSingleLine[OleVariant(h),OleVariant(0)] := EXG2ANTTLib_TLB.exCaptionWordWrap; CellValueFormat[OleVariant(h),OleVariant(0)] := EXG2ANTTLib_TLB.exHTML; end; EndUpdate(); end |
1404 |
Is it possible to allow moving an item to another, but keeping its indentation
with G2antt1 do begin BeginUpdate(); VisualAppearance.Add(1,'c:\exontrol\images\normal.ebn'); AutoDrag := EXG2ANTTLib_TLB.exAutoDragPositionKeepIndent; LinesAtRoot := EXG2ANTTLib_TLB.exNoLinesAtRoot; HasLines := EXG2ANTTLib_TLB.exThinLine; ShowFocusRect := False; Columns.Add('Task'); with Chart do begin ShowNonworkingDates := False; FirstVisibleDate := '12/29/2000'; PaneWidth[False] := 96; LevelCount := 2; Bars.Item['Task'].Color := $1000000; end; with Items do begin h := AddItem('Group 1'); ItemDivider[h] := 0; ItemBold[h] := True; h1 := InsertItem(h,Null,'Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null); h2 := InsertItem(h,Null,'Task 2'); AddBar(h2,'Task','1/5/2001','1/7/2001','K2',Null); AddLink('L1',h1,'K1',h2,'K2'); Link['L1',EXG2ANTTLib_TLB.exLinkText] := 'L1'; h3 := InsertItem(h,Null,'Task 3'); AddBar(h3,'Task','1/8/2001','1/10/2001','K3',Null); AddLink('L2',h2,'K2',h3,'K3'); Link['L2',EXG2ANTTLib_TLB.exLinkText] := 'L2'; ExpandItem[h] := True; h := AddItem('Group 2'); ItemBold[h] := True; ItemDivider[h] := 0; end; EndUpdate(); end |
1403 |
How can I change the row's position to another, by drag and drop. Is it possible
with G2antt1 do begin BeginUpdate(); VisualAppearance.Add(1,'c:\exontrol\images\normal.ebn'); AutoDrag := EXG2ANTTLib_TLB.exAutoDragPosition; Columns.Add('Task'); with Chart do begin ShowNonworkingDates := False; FirstVisibleDate := '12/29/2000'; PaneWidth[False] := 64; LevelCount := 2; Bars.Item['Task'].Color := $1000000; end; with Items do begin h1 := AddItem('Task 1'); AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null); h2 := AddItem('Task 2'); AddBar(h2,'Task','1/5/2001','1/7/2001','K2',Null); AddLink('L1',h1,'K1',h2,'K2'); Link['L1',EXG2ANTTLib_TLB.exLinkText] := 'L1'; h3 := AddItem('Task 3'); AddBar(h3,'Task','1/8/2001','1/10/2001','K3',Null); AddLink('L2',h2,'K2',h3,'K3'); Link['L2',EXG2ANTTLib_TLB.exLinkText] := 'L2'; end; EndUpdate(); end |
1402 |
Is it possible to scroll the control's content by clicking and moving the mouse up or down
// AddItem event - Occurs after a new Item has been inserted to Items collection. procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM); begin with G2antt1 do begin with Items do begin AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null); end; end end; with G2antt1 do begin BeginUpdate(); with Chart do begin FirstVisibleDate := '8/3/1994'; PaneWidth[False] := 256; LevelCount := 2; UnitScale := EXG2ANTTLib_TLB.exDay; FirstWeekDay := EXG2ANTTLib_TLB.exMonday; OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible; end; ColumnAutoResize := False; ContinueColumnScroll := False; rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset); with rs do begin Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null); end; DataSource := (IUnknown(rs) as ADODB_TLB.Recordset); AutoDrag := EXG2ANTTLib_TLB.exAutoDragScroll; EndUpdate(); end |
1401 |
How can I display bars so they fit the entire height ( height of the row )
with G2antt1 do begin BeginUpdate(); VisualAppearance.Add(1,'c:\exontrol\images\normal.ebn'); DefaultItemHeight := 36; with Chart do begin PaneWidth[False] := 164; FirstVisibleDate := '1/1/2001'; UnitWidth := 48; LevelCount := 2; UnitScale := EXG2ANTTLib_TLB.exHour; NonworkingHours := 16253183; ShowNonworkingUnits := False; UnitWidth := 16; FirstVisibleDate := '1/1/2012 8:00:00 AM'; DrawGridLines := EXG2ANTTLib_TLB.exAllLines; Bars.Add('Empty').Pattern := EXG2ANTTLib_TLB.exPatternEmpty; with Level[0] do begin Alignment := Integer(EXG2ANTTLib_TLB.exHOutside) Or Integer(EXG2ANTTLib_TLB.CenterAlignment); Label := '<%d2%>'; end; AllowLinkBars := False; AllowCreateBar := EXG2ANTTLib_TLB.exNoCreateBar; BarsAllowSizing := False; AllowSelectObjects := EXG2ANTTLib_TLB.exNoSelectObjects; end; DrawGridLines := EXG2ANTTLib_TLB.exAllLines; ShowFocusRect := False; with Columns do begin with (IUnknown(Add('CA')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellSingleLine] := OleVariant(False); Def[EXG2ANTTLib_TLB.exCellValueFormat] := OleVariant(1); end; with (IUnknown(Add('CB')) as EXG2ANTTLib_TLB.Column) do begin Def[EXG2ANTTLib_TLB.exCellSingleLine] := OleVariant(False); Def[EXG2ANTTLib_TLB.exCellValueFormat] := OleVariant(1); end; end; with Items do begin h := AddItem('Address 1.1<br>Line 2.1<br>C1'); ItemMaxHeight[h] := 96; CellValue[OleVariant(h),OleVariant(1)] := 'Address 1.2<br>Line 2.2<br>C2'; AddBar(h,'Empty','1/2/2012 8:00:00 AM','1/2/2012 7:00:00 PM','A','This is a bit of text<br>being <font ;9>displayed ion the <b>bar A'); ItemBar[h,'A',EXG2ANTTLib_TLB.exBarBackColor] := OleVariant(16777471); ItemBar[h,'A',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(0); ItemBar[h,'A',EXG2ANTTLib_TLB.exBarVAlignCaption] := OleVariant(2); AddBar(h,'Empty','1/3/2012 8:00:00 AM','1/3/2012 7:00:00 PM','B','<fgcolor=FFFFFF>This is a bit of text<br><fgcolor=FFFFFF>being <font ;9>displayed ion the <b>bar B'); ItemBar[h,'B',EXG2ANTTLib_TLB.exBarBackColor] := OleVariant(33488896); ItemBar[h,'B',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(2); ItemBar[h,'B',EXG2ANTTLib_TLB.exBarVAlignCaption] := OleVariant(0); AddBar(h,'Empty','1/4/2012 8:00:00 AM','1/4/2012 7:00:00 PM','C','<font Tahoma;12><b>bar C'); ItemBar[h,'C',EXG2ANTTLib_TLB.exBarBackColor] := OleVariant(33489151); end; EndUpdate(); end |